KM2 is a powerful macro-processor which allows to generate automatically files written with trees and graphs and icons.
Today, KM2 uses the XMind format, but will use other sources in the future.
1. Introduction to the KM2 processor
1.1. introduction to SGH schemes
1.1.1. Using SGH schemes
The studies in Knowledge Management have led to important results :
- thinking is not linear
- ideas are bound together by graphs
- visual thinking is important
- the classical way of writing is linear (letters --> words --> sentences --> paragraphes --> texts), and is does not represent adequately the human thinking process.
- decoding linear strucures for extracting the knowledge is something which is complicated and error-prone.
SGH schemes try to solve these issues by :
- organizing knowledge as trees and graphs.
-
trees represent naturally :
- The decomposition of problems into subproblems
- the decomposition of objects into sub-parts
-
graphs represent naturally
- complex relationships between objects
- causality links
- time links
- etc
- using icons and images to illustrate ideas.
- propose hyperlinks that allow to link ideas together
SGH schemes are quite known in the world of mind-mapping. KM2 is (presently) based on a writing tool which is Xmind (notably Xmind 8 pro).
SGH schemes are richer than 'usual' mind maps : the TABLE' notion is used extensively.
Tables are just tables, but propose a structured presentation of the knowledge which is not accessible through trees.
Examples of SGH schemes
The water cycle
The water cycle
|
It is hard to explain simply the water cycle :
a drawing is worth a thousand words. |
1.2. The KM2 processor
The KM2 processor is based on the conjunction of several ideas :- Documents can be generated from trees and graphics
- Use of SGH schemes
- The mapping from graphics to document can be controlled
- The mapping is extended by standard and user_defined macros.
- Python is a unique language for the internal processing.
1.2.1. From graphs to documents
The first idea is to represent texts by trees, graphs and drawings :
Then the drawing is converted into documents, should they be text or programms or whatever. The final form of the conversion is defined by the language. ==> From the same tree many differents texts can be generated. |
|
Programms and text in KM2 are described by Xmind trees.
The processor uses a depth first walking routine to generate documents in several languages : python, prolog, html, C, java, javascript, etc. The KM2 processor works in 2 steps :
The standard order of walking through the tree is called "depth first" : this is the baisc linearisation of a tree as depicted on the right. |
|
1.2.2. Control of the mapping
When visiting nodes, some nodes have a special syntax that is processed according to a set of standard and user-defined rules.
1.2.3. Extension of the base langage with notations
There are rules for many languages and text documents.
for more information about python, check the M2 for python documentation
here.
Example for html :
|
|
This is just
We have 2 bugs here :
|
for more information about python, check the M2 for python documentation
here.
Example for Python :
|
|
def fact (n) : # DESCRIPTION # returns the factorial of any number if n < 2 : return 1 else : return n * fact (n-1) |
Example for javascript :
|
|
function fact (n) { // DESCRIPTION // returns the factorial of any number if (n < 2) { return 1; } else { return n * fact (n-1); } } |
There is a subtle difference between a notation and a macro :
- A notation describes the EXTERNAL view of an SGH
- A macro can be associated to a notation, and explains HOW the SGH scheme associated to this notation can be transformed into something else.
1.2.4. Python as the embedded programming language for extensions
1.3. For advanced users
using constants, etc1.3.1. Programming in KM2, using constants, etc
1.3.2. Non-linearity with the KM2 processor
...